n = int(input())
a,b = 1,1
fibo=0
while fibo<=n:
    fibo = a + b
    b = a
    a = fibo
print(fibo)